import '../common/bean/Message.dart';

/// model : "deepseek-r1:70b"
/// created_at : "2025-02-26T02:18:27.437018576Z"
/// message : {"role":"assistant","content":"的"}
/// done : false

class StreamMessageDto {
  StreamMessageDto({
      String? model, 
      String? createdAt, 
      Message? message, 
      bool? done,}){
    _model = model;
    _createdAt = createdAt;
    _message = message;
    _done = done;
}

  StreamMessageDto.fromJson(dynamic json) {
    _model = json['model'];
    _createdAt = json['created_at'];
    _message = json['message'] != null ? Message.fromJson(json['message']) : null;
    _done = json['done'];
  }
  String? _model;
  String? _createdAt;
  Message? _message;
  bool? _done;
StreamMessageDto copyWith({  String? model,
  String? createdAt,
  Message? message,
  bool? done,
}) => StreamMessageDto(  model: model ?? _model,
  createdAt: createdAt ?? _createdAt,
  message: message ?? _message,
  done: done ?? _done,
);
  String? get model => _model;
  String? get createdAt => _createdAt;
  Message? get message => _message;
  bool? get done => _done;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['model'] = _model;
    map['created_at'] = _createdAt;
    if (_message != null) {
      map['message'] = _message?.toJson();
    }
    map['done'] = _done;
    return map;
  }

}